<?php

class Index_Controller extends Public_Controller
{
    /**
     * 框架首页
     */
    public function indexAction()
    {
        //禁用布局视图
        $this->view->layout = null;

        //网站名称
        $site = Work::config()->load('site');

        //关闭跟踪信息
        Work::config()->SHOW_TRACE = false;

        $this->view->set(array(
            'site'  => $site,
        ));
        $this->view->display();
    }

    /**
     * 菜单目录层级
     */
    public function posAction()
    {
        //禁用布局视图
        $this->view->layout = null;

        //关闭跟踪信息
        Work::config()->SHOW_TRACE = false;

        //菜单编号
        $menu_key = $this->get('key');

        //点击的菜单类型，顶部和左边
        $type = $this->get('type','left');
        
        $this->view->set(array(
            //'pos'  => $pos[$id]
        ));
        //$this->view->display();
    }

    /**
     * 左边菜单栏目
     */
    public function leftAction()
    {
        //禁用布局视图
        $this->view->layout = null;

        //关闭跟踪信息
        Work::config()->SHOW_TRACE = false;

        $menu_key = $this->get('key');
        $this->view->set(array(
            'menu_key' => $menu_key,
        ));
        $this->view->display();
    }

    /**
     * 右边首页正文
     */
    public function rightAction()
    {
        //Work::widget('test');
        Work::config()->SHOW_TRACE = true;
        $this->view->display();
    }
}
